<?php
$id=$_GET['ccid'];
$mchungchi=new Model_Chungchi;
if(isset($_POST['ok'])){
	if($_POST['txtcc'] == NULL){
		$data['error'][]=ERROR_CHUNGCHI_EMPTY;
	}else{
		$cc=$_POST['txtcc'];
	}
	if($cc){
		$data=array(
			"TEN_CC" => $cc
		);
		
		if($mchungchi->update_chungchi($data,$id) == TRUE){
			redirect("index.php?module=chungchi&act=list");
		}else{
			$data['error'][]=ERROR_CHUNGCHI_CREATE;
		}
	}
}
$data['info']=$mchungchi->getchungchi($id);
loadview("chungchi/edit_view",$data);